Ext.define('Html5App.view.report.ReportSales', {
	alternateClassName : 'reportSales',
	extend : 'Ext.Container',
	xtype : 'reportSales',
	id : 'reportSales',
	requires : [],
	config : {
		height : '100%',
		items : [{
			xtype : 'container',
			cls : 'order-record-label',
			layout : {
				type : 'hbox'
			},
			items : [{
				flex : 2,
				xtype : 'panel',
				cls : 'customer-info-padding report-customer-list-options',
				id : 'sales-progress-customer-label',
				html : '全部',
				listeners : {
					element : 'element',
					singletap : function() {
						var panel = Ext.Viewport.add({
							xtype : 'customerList'
						});
						panel.show();
					}
				}
			},{
				flex : 1,
				xtype : 'panel',
				cls : 'order-record-report',
				html : '戶口銷售進度'
			}]
		},{
			xtype : 'container',
			cls : 'sales-progress-query-container',
			layout : {
				type : 'hbox'
			},
			items : [{
				cls : 'sales-progress-query-text-right',
				html : '日期：'
			},{
				flex : 1,
				xtype: 'custom_date_field',
				id: 'salesProgressBeginDate',
				value: '',
				data: ''
			},{
				cls : 'sales-progress-query-text-center',
				html : '至'
			},{
				flex : 1,
				xtype: 'custom_date_field',
				id: 'salesProgressEndDate',
				value: '',
				data: ''
			},{
				cls : 'sales-progress-query-radio',
				xtype : 'image',
				id : 'queryRadioDate',
				src : './resources/images/radio_checked.png',
				listeners : {
					tap : function(button, e, eOpts) {
						Ext.getCmp('queryRadioDate').setSrc('./resources/images/radio_default.png');
						Ext.getCmp('queryRadioMonth').setSrc('./resources/images/radio_default.png');
						button.setSrc('./resources/images/radio_checked.png');
						custom.salesProgressView(0);
					}
				}
			}]
		},{
			xtype : 'container',
			hidden : true,
			cls : 'sales-progress-query-container',
			layout : {
				type : 'hbox'
			},
			items : [{
				cls : 'sales-progress-query-text-right',
				html : '月份：'
			},{
				flex : 1,
				xtype: 'custom_year_month_field',
				id: 'salesProgressBeginMonth',
				value: '',
				data: ''
			},{
				cls : 'sales-progress-query-text-center',
				html : '至'
			},{
				flex : 1,
				xtype: 'custom_year_month_field',
				id: 'salesProgressEndMonth',
				value: '',
				data: ''
			},{
				cls : 'sales-progress-query-radio',
				xtype : 'image',
				id : 'queryRadioMonth',
				src : './resources/images/radio_default.png',
				listeners : {
					tap : function(button, e, eOpts) {
						Ext.getCmp('queryRadioDate').setSrc('./resources/images/radio_default.png');
						Ext.getCmp('queryRadioMonth').setSrc('./resources/images/radio_default.png');
						button.setSrc('./resources/images/radio_checked.png');
						custom.salesProgressView(1);
					}
				}
			}]
		},{
			html : '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-top:1px solid #CFCFCF;border-bottom:1px solid #CFCFCF;font-size:0.7rem;color:#4C4C4C;">'+
					  '<tr style="height:2rem;text-align:center;">'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:25%;" colspan="2">貨品編號</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:25%;">貨品名稱</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:10%;">單位</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:15%;">單價</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:10%;">數量</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;width:15%;">項計</td>'+
					  '</tr>'+
				  '</table>'
		},{
			xtype : 'container',
			cls : 'sales-progress-container',
			scrollable : 'vertical',
			height : '100%',
			items : [{
				id : 'sales-progress-data',
				html : ''
			},{
				xtype : 'container',
				style : 'margin-top: -1px;',
				docked : 'bottom',
				height : '2rem',
				id : 'sales-progress-data-sum'
			}]
		}]
	}
});